package com.hck.domain.doctor.model.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * DoctorEntity class description here.
 *
 * @author 黄朝看
 * @date 2025/7/2
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class DoctorEntity {
    private Long doctorId;
    private String loginName;
    private String password;
    private String name;
    private String title;
    private String department;
    private String hospital;
    private String specialty;
    private Integer experienceYears;
    private String education;
    private String introduction;
    private String avatar;
    private String phone;
    private String email;
    private Double consultationFee;
    private Double rating;
    private Integer consultationCount;
    private Integer status;
    private Date lastLoginTime;
    private Date createTime;
    private Date updateTime;

    /**
     * 检查用户是否可以登录
     */
    public boolean canLogin() {
        return status != null && status == 1;
    }

    /**
     * 更新登录信息
     */
    public void updateLoginInfo() {
        this.lastLoginTime = new Date();
    }

    /**
     * 验证密码
     */
    public boolean validatePassword(String inputPassword, String encodedPassword) {
        // 这里应该使用密码加密工具进行验证
        // 暂时使用简单比较，实际项目中应该使用BCrypt等
        return encodedPassword.equals(inputPassword);
    }
}  
